﻿<div id="@Entity.Oid"
     data-entity-node="true"
     data-location="@NodeLocation"
     data-connections="@NodeConnections"
     data-entity-node-selected="@IsSelected"
     data-class-name="entity-node connection-target-endpoint"
     @ondblclick="DoubleClicked" @ondblclick:stopPropagation>
    <div class="entity-caption d-flex">
        <div class="left connection-source-endpoint"></div>
        <div class="right connection-source-endpoint"></div>
        <div class="top connection-source-endpoint"></div>
        <div class="xaf-flex-auto">
            <div class="entity-caption-text">@NodeTitle</div>
        </div>
        @if (!string.IsNullOrWhiteSpace(Entity.ImageName))
        {
            <XafImage Size="16" ImageName="@Entity.ImageName" />
        }
    </div>
    <div class="properties">
        @foreach (var property in Entity.Properties.OrderBy(p => p.Order))
        {
            <div @key="property.Oid" id="@property.Oid" class="@GetPropertyClassName(property)">
                @if (IsNavigationProperty(property))
                {
                    <div class="left connection-source-endpoint" data-property-id="@property.Oid"></div>
                    <div class="right connection-source-endpoint" data-property-id="@property.Oid"></div>
                }
                <div class="property-icon me-2">
                    <XafImage ImageName="@property.PropertyTypeImage" Size="16" />
                </div>
                <div class="property-caption">@GetPropertyTitle(property)</div>
                <div class="property-type">@property.TypeSummary</div>
            </div>
        }
    </div>
</div>
